<!DOCTYPE html>
<!--支付宝用户列表-->
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:include="css :: css">
</head>
<link href="/js/jquery.icheck/skins/square/blue.css" rel="stylesheet">
<link href="/css/bootstrap-toggle.min.css" rel="stylesheet">
<link href="/js/jquery.icheck/skins/square/blue.css" rel="stylesheet">
<link href="/css/chosen.css" rel="stylesheet">
<body style="opacity: 1">
<div style="padding-top: 0">
    <div class="container-fluid">
        <div class="cl-mcont">
            <div class="row">
                <div class="col-md-12" style="padding:0">
                    <div class="block-flat">
                        <form class="form-horizontal group-border-dashed" id="buyCode">
                            <input type="hidden" id="productTypes" name="productTypes">
                            <input type="hidden" id="statusArray" name="statusArray">
                            <div class="form-group">
                                <div class="input-group">
                                    <input type="text" class="form-control" id="account" name="account"
                                           placeholder="用户手机号"/>
                                </div>
                                <div class="input-group">
                                    <input type="text" class="form-control" id="realName" name="realName"
                                           placeholder="真实姓名"/>
                                </div>
                                <div class="input-group">
                                    <input type="text" class="form-control" id="nickName" name="nickName"
                                           placeholder="昵称"/>
                                </div>
                                <div class="input-group">
                                    <select class="form-control " id="authenticationStatus" name="authenticationStatus">
                                        <option value="" selected>认证状态</option>
                                        <option value="1">认证成功</option>
                                        <option value="2">认证失败</option>
                                        <option value="3">认证中</option>
                                    </select>
                                </div>
                                <div class="input-group">
                                    <button class="btn btn-primary" type="button" id="search"><i
                                            class="fa fa-search"></i>查询
                                    </button>
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="block-flat">
                        <div class="content">
                            <div class="table-responsive">
                                <table class="table hover" id="dataTable">
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>

</div>
<div th:include="js :: js"></div>
<script type="text/javascript" th:attr="src=@{/js/jquery.form.js}"></script>
<script type="text/javascript" th:attr="src=@{/js/jquery.parser.js}"></script>
<script type="text/javascript" src="js/jquery.icheck/icheck.min.js"></script>
<script type="text/javascript" src="/js/chosen.jquery.js?deVersion=20181411895"></script>
<script>
    $(function () {
        var myDate = new Date();
        var month = myDate.getMonth() + 1;
        var day = myDate.getDate();
        if (month < 10) {
            month = "0" + month;
        }
        if (day < 10) {
            day = "0" + day;
        }
        var _start = myDate.getFullYear() + '-' + month + '-' + day + " 00:00:00";
        var _end = myDate.getFullYear() + '-' + month + '-' + day + " 23:59:59";
        $("#startTime").val(_start);
        $("#endTime").val(_end);
        laydate.render({
            elem: '#startTime',
            type: 'datetime'

        });
        laydate.render({
            elem: '#endTime'
            , type: 'datetime'
        });
        $('#dataTable').bootstrapTable({
            url: '/aliProgramUser/queryPage',
            height: $(window).height() - 200,
            pageSize: 100,
            pagination: true,
            pageList: [30, 50, 100],
            clickToSelect: true,
            queryParams: queryParams,
            uniqueId: 'id',
            queryParamsType: '',
            sidePagination: 'server',
            responseHandler: function (res) {
                return {
                    "total": res.total,//总页数
                    "rows": res.resultList   //数据
                };
            },
            columns: [
                {
                    checkbox: true,
                    align: 'center'
                },
                {
                    field: 'aliUserId',
                    title: '支付宝用户ID',
                    width: 90, align: 'center'
                },
                {
                    field: 'account',
                    title: '用户手机号',
                    width: 90, align: 'center'
                },
                {
                    field: 'nickName',
                    title: '昵称',
                    width: 50,
                    align: 'center'
                },
                {
                    field: 'authenticationStatus',
                    title: '实名认证状态',
                    width: 50,
                    align: 'center',
                    formatter: function (v, row, index) {
                        return authenticationStatus(v);
                    }
                }, {
                    field: 'realName',
                    title: '真实姓名',
                    width: 50,
                    align: 'center'
                }, {
                    field: 'certNo',
                    title: '身份证号',
                    width: 50,
                    align: 'center'
                },
                {
                    align: 'center', field: 'createTime', title: '创建时间', width: 300, formatter: function (v, o) {
                    return (o.createTime != null ? o.createTime.split('.')[0] : "");
                }
                },
                {
                    align: 'center', field: 'modifiedTime', title: '修改时间', formatter: function (v, o) {
                    return (o.modifiedTime != null ? o.modifiedTime.split('.')[0] : "");
                }
                },
                {
                    align: 'center', field: 'authenticationTime', title: '认证时间', formatter: function (v, o) {
                    return o.authenticationTime != null ? o.authenticationTime.split('.')[0] : "";
                }
                },
                {
                    field: 'remark',
                    title: '备注',
                    width: 100,
                    align: 'center'
                }
            ]
        });
        $("#search").click(function () {
            var timeAdd = new Date($("#startTime").val());
            var timeEnd = new Date($("#endTime").val());
            if (timeAdd > timeEnd) {
                layer.msg("开始时间不能大于结束时间");
                return false;
            }
            var require = (timeEnd - timeAdd) / (1 * 24 * 60 * 60 * 1000);
            if (require > 7) {
                layer.msg("时间间隔不能超过7天");
                return;
            }
            $("#dataTable").bootstrapTable("refresh");
        });

        function queryParams(params) {
            return {
                page: params.pageNumber,
                size: params.pageSize,
                //startTime: $("#startTime").val(),
                //endTime: $("#endTime").val(),
                aliUserId: $.trim($("#aliUserId").val()),
                realName: $.trim($("#realName").val()),
                account: $.trim($("#account").val()),
                nickName: $.trim($("#nickName").val()),
                authenticationStatus: $.trim($("#authenticationStatus").val()),
                aliUserId: $.trim($("#aliUserId").val()),
                certNo: $.trim($("#certNo").val())
            };
        }
    })
</script>
</body>
</html>
